Assume I have a table services with columns:id,name,price and I have made select box in some blade page, and I want to extract a price from that selectbox options.
<select x-model="service.service"
name="services[]"
class="input rounded-sm">
<option >-- choose service --</option>
@foreach ($services as $service)
<option x-init="x={{number_format($service->price, 2)}}" value="{{$service->id}}">
{{ $service->name }} (${{ number_format($service->price, 2) }})</p>
</option>
@endforeach
</select>
this code retrives only the last price from the select? it print "Unit Price: 855" and stack on that value.
I want the text change when selecting diffrent value
please dont mention:
value ={{service->prie}}